package com.nts.visionworks.business.application.domain;

// Generated 2013. 7. 18 ���� 5:59:34 by Hibernate Tools 4.0.0

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.codehaus.jackson.annotate.JsonIgnore;

import com.nts.visionworks.core.validation.EntityIdNotNull;

/**
 * ApplicationSetting generated by hbm2java
 */
@Entity
@Table(name = "application_setting", catalog = "visionworks")
public class ApplicationSetting implements java.io.Serializable
{

	private ApplicationSettingId id;
	private ServiceApplication serviceApplication;
	private String settingKey;
	private String settingValue;

	public ApplicationSetting()
	{
	}

	public ApplicationSetting(ApplicationSettingId id,
			ServiceApplication serviceApplication, String settingKey,
			String settingValue)
	{
		this.id = id;
		this.serviceApplication = serviceApplication;
		this.settingKey = settingKey;
		this.settingValue = settingValue;
	}

	@EmbeddedId
	@AttributeOverrides(
	{
			@AttributeOverride(name = "settingId", column = @Column(name = "SettingId", nullable = false)),
			@AttributeOverride(name = "applicationId", column = @Column(name = "ApplicationId", nullable = false))
	})
	public ApplicationSettingId getId()
	{
		return this.id;
	}

	public void setId(ApplicationSettingId id)
	{
		this.id = id;
	}

	@EntityIdNotNull(message = "validation.serviceApplicationSetting.serviceApplication.notNull")
	@JsonIgnore
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ApplicationId", nullable = false, insertable = false, updatable = false)
	public ServiceApplication getServiceApplication()
	{
		return this.serviceApplication;
	}

	public void setServiceApplication(ServiceApplication serviceApplication)
	{
		this.serviceApplication = serviceApplication;
	}

	@NotNull(message = "validation.serviceApplicationSetting.settingKey.notNull")
	@Size(message = "validation.serviceApplicationSetting.settingKey.length", max = 20, min = 1)
	@Column(name = "SettingKey", nullable = false, length = 20)
	public String getSettingKey()
	{
		return this.settingKey;
	}

	public void setSettingKey(String settingKey)
	{
		this.settingKey = settingKey;
	}

	@NotNull(message = "validation.serviceApplicationSetting.settingValue.notNull")
	@Size(message = "validation.serviceApplicationSetting.settingValue.length", max = 100, min = 1)
	@Column(name = "SettingValue", nullable = false, length = 100)
	public String getSettingValue()
	{
		return this.settingValue;
	}

	public void setSettingValue(String settingValue)
	{
		this.settingValue = settingValue;
	}

}
